import { _decorator, Component, Node, Label } from 'cc';
const { ccclass, property } = _decorator;

import { SSS_Consts } from "../../../../Script/Data/SSS_Consts";
import { bdlMgr } from "../../../../Script/Manager/BundleManager_S";
import { SS_GameEventData } from "../../../../Script/Manager/SSS_GameEventManager";

@ccclass('Suan24DianLosePanel')
export default class S2048_LosePanel extends Component {
    public static Instance: S2048_LosePanel;
    @property(Node)
    public Button_menu: Node | null = null;
    @property(Node)
    public Button_replay: Node | null = null;
    @property(Node)
    public Button_revive: Node | null = null;
    @property(Label)
    Label_score: Label | null = null;
    @property(Label)
    Label_high_score: Label | null = null;
    index: number;
    onLoad() {
        // S2048_LosePanel.Instance = this;
    }
    ShowOn() {
        // this.node.active = true;
        // this.AddListener();
        // this.Refresh();

        //        // let audio_root = `audio/level failed`;
        // let audio_root = `audio/fail`;
        // bdlMgr.getRes<cc.AudioClip>(SSS_Consts.BundleName.AUDIO, audio_root, cc.AudioClip).then(res => { cc.audioEngine.playEffect(res, false); });

        //        // S2048_GameData.ClearData();
    }
    ShowOff() {
        // this.node.destroy();
        // this.RemoveListener();
    }
    Refresh() {
        //        // this.Label_score.string = `本局得分：${DragTetris_GameData.GetScore()}`;
        //        // this.Label_high_score.string = `最高纪录：${DragTetris_GameStorage.data.high_score}`;

        //        // this.Label_score.string = `${S2048_GameData.GetScore()}`;
        //        // this.Label_high_score.string = `${S2048_GameStorage.data[S2048_GameData.Game_mode].high_score}`;
    }
    AddListener() {
        // this.Button_menu.on(cc.Node.EventType.TOUCH_END, this.On_Button_menu, this);
        // this.Button_replay.on(cc.Node.EventType.TOUCH_END, this.On_Button_replay, this);
        // this.Button_revive.on(cc.Node.EventType.TOUCH_END, this.On_Button_revive, this);
    }
    RemoveListener() {
        // this.Button_menu.off(cc.Node.EventType.TOUCH_END, this.On_Button_menu, this);
        // this.Button_replay.off(cc.Node.EventType.TOUCH_END, this.On_Button_replay, this);
        // this.Button_revive.off(cc.Node.EventType.TOUCH_END, this.On_Button_revive, this);
    }
    On_Button_menu() {
        //        // console.log(`On_Button_menu`);

        // this.ShowOff();
        // cc.systemEvent.emit(SS_GameEventData.Menu);
        // AudioManager.PlayButtonAudio();
    }
    On_Button_replay() {
        //        // console.log(`On_Button_replay`);

        // this.ShowOff();
        // cc.systemEvent.emit(SS_GameEventData.Replay);
        // AudioManager.PlayButtonAudio();
    }
    On_Button_revive() {
        //        // console.log(`On_Button_revive`);

        // let audio_root = `audio/life received`;
        // bdlMgr.getRes<cc.AudioClip>(SSS_Consts.BundleName.AUDIO, audio_root, cc.AudioClip).then(res => { cc.audioEngine.playEffect(res, false); });

        // this.ShowOff();
        // cc.systemEvent.emit(SS_GameEventData.Revive);
        // AudioManager.PlayButtonAudio();
    }
}
